package demoMod.stsconsole.monsters.exordium;

import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.monsters.AbstractMonster;
import demoMod.stsconsole.powers.RitualPower;

import java.util.Random;

public class Cultist extends AbstractMonster {
    public static final String ID = "Cultist";

    public Cultist() {
        super(ID);
        this.setHp(48, 54);
        this.damage.add(new DamageInfo(6, this));
    }

    @Override
    protected void getMove(int aiRng) {
        if (this.firstMove) {
            setMove(0, Intent.BUFF, monsterStrings.get(1));
            firstMove = false;
        } else {
            setMove(1, Intent.ATTACK, this.damage.get(0));
        }
    }

    @Override
    public void takeTurn() {
        switch (this.nextMove) {
            case 0:
                this.talk(monsterStrings.get(2 + new Random().nextInt(2)));
                this.applyPower(this, new RitualPower(this, 4));
                break;
            case 1:
                this.defaultTarget.damage(this.damage.get(0));
                break;
        }
        getMove(0);
    }

    @Override
    public void die() {
        super.die();
        this.talk(monsterStrings.get(4));
    }
}
